﻿using System;
using System.Xml.Serialization;
using Kiva7.Translations;

namespace Kiva7.DataClasses
{
    public class Comment
    {
        [XmlElement("id")]
        public int Id { get; set; }
        [XmlElement("author")]
        public string Author { get; set; }
        [XmlElement("whereabouts")]
        public string Subject { get; set; }
        [XmlElement("body")]
        public string Body { get; set; }

        private Translation _translation;
        [XmlIgnore]
        public Translation Translation
        {
            get
            {
                if (_translation == null)
                {
                    _translation = new Translation(Body);
                }
                return _translation;
            }
        }
        [XmlElement("date")]
        public DateTime Date { get; set; }
    }
}
